/*    */ package com.zimbra.cs.account.callback;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.cs.account.AttributeCallback;
/*    */ import com.zimbra.cs.account.AttributeCallback.SingleValueMod;
/*    */ import com.zimbra.cs.account.Config;
/*    */ import com.zimbra.cs.account.Entry;
/*    */ import com.zimbra.cs.account.Provisioning;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class UCProvider
/*    */   extends AttributeCallback
/*    */ {
/*    */   public void preModify(CallbackContext context, String attrName, Object attrValue, Map attrsToModify, Entry entry)
/*    */     throws ServiceException
/*    */   {
/* 31 */     AttributeCallback.SingleValueMod mod = singleValueMod(attrsToModify, attrName);
/* 32 */     if (mod.unsetting()) {
/* 33 */       return;
/*    */     }
/*    */     
/* 36 */     String newValue = mod.value();
/* 37 */     String allowedValue = Provisioning.getInstance().getConfig().getUCProviderEnabled();
/*    */     
/* 39 */     if (allowedValue == null) {
/* 40 */       throw ServiceException.INVALID_REQUEST("no zimbraUCProviderEnabled is configured on global config", null);
/*    */     }
/*    */     
/*    */ 
/* 44 */     if (!allowedValue.equals(newValue)) {
/* 45 */       throw ServiceException.INVALID_REQUEST("UC provider " + newValue + " is not allowed " + " by " + "zimbraUCProviderEnabled", null);
/*    */     }
/*    */   }
/*    */   
/*    */   public void postModify(CallbackContext context, String attrName, Entry entry) {}
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/account/callback/UCProvider.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */